package com.duowei.diandan.bean;

import com.duowei.diandan.sql.ColumnName;
import com.duowei.diandan.sql.InsertField;
import com.duowei.diandan.sql.TableName;

import org.joda.time.LocalDateTime;

/**
 * 消费明细(MySQL)
 */
@TableName(name = "deal_record")
public class DealRecord {
    // `id` int(10) unsigned NOT NULL AUTO_INCREMENT,

    @InsertField
    private Integer weid; // int(10) NOT NULL,
    @InsertField
    @ColumnName(name = "from_user")
    private String fromUser; // varchar(50) NOT NULL,
    @InsertField
    private LocalDateTime jysj; // datetime NOT NULL COMMENT '交易时间',
    @InsertField
    private String jylx; // varchar(20) DEFAULT NULL,
    @InsertField
    @ColumnName(name = "deal_id")
    private String dealId; // varchar(50) DEFAULT NULL COMMENT '交易记录id',
    @InsertField
    private String bmbh; // varchar(10) DEFAULT NULL,
    @InsertField
    private String syjh; // varchar(200) DEFAULT NULL,
    @InsertField
    private String yhmc; // varchar(50) DEFAULT NULL,
    @InsertField
    private Float cash; // decimal(10,2) DEFAULT NULL,
    @InsertField
    private Float jezj; // decimal(10,2) DEFAULT NULL,
    @InsertField
    private Float payment1; // decimal(10,2) DEFAULT '0.00' COMMENT '储值卡支付金额',
    @InsertField
    private Float payment2; // decimal(10,2) DEFAULT '0.00' COMMENT '支付方式',
    @InsertField
    private Float payment3;  // decimal(10,2) DEFAULT '0.00' COMMENT '支付方式',
    @InsertField
    private Float payment4; // decimal(10,2) DEFAULT '0.00' COMMENT '支付方式',
    @InsertField
    private Float payment5; // decimal(10,2) DEFAULT '0.00' COMMENT '支付方式',
    @InsertField
    private String xsdh; // varchar(100) DEFAULT NULL COMMENT '销售单号',
    @InsertField
    private Integer uid; // int(10) DEFAULT '0',

    public DealRecord() {
    }

    public Integer getWeid() {
        return weid;
    }

    public void setWeid(Integer weid) {
        this.weid = weid;
    }

    public String getFromUser() {
        return fromUser;
    }

    public void setFromUser(String fromUser) {
        this.fromUser = fromUser;
    }

    public LocalDateTime getJysj() {
        return jysj;
    }

    public void setJysj(LocalDateTime jysj) {
        this.jysj = jysj;
    }

    public String getJylx() {
        return jylx;
    }

    public void setJylx(String jylx) {
        this.jylx = jylx;
    }

    public String getDealId() {
        return dealId;
    }

    public void setDealId(String dealId) {
        this.dealId = dealId;
    }

    public String getBmbh() {
        return bmbh;
    }

    public void setBmbh(String bmbh) {
        this.bmbh = bmbh;
    }

    public String getSyjh() {
        return syjh;
    }

    public void setSyjh(String syjh) {
        this.syjh = syjh;
    }

    public String getYhmc() {
        return yhmc;
    }

    public void setYhmc(String yhmc) {
        this.yhmc = yhmc;
    }

    public Float getCash() {
        return cash;
    }

    public void setCash(Float cash) {
        this.cash = cash;
    }

    public Float getJezj() {
        return jezj;
    }

    public void setJezj(Float jezj) {
        this.jezj = jezj;
    }

    public Float getPayment1() {
        return payment1;
    }

    public void setPayment1(Float payment1) {
        this.payment1 = payment1;
    }

    public Float getPayment2() {
        return payment2;
    }

    public void setPayment2(Float payment2) {
        this.payment2 = payment2;
    }

    public Float getPayment3() {
        return payment3;
    }

    public void setPayment3(Float payment3) {
        this.payment3 = payment3;
    }

    public Float getPayment4() {
        return payment4;
    }

    public void setPayment4(Float payment4) {
        this.payment4 = payment4;
    }

    public Float getPayment5() {
        return payment5;
    }

    public void setPayment5(Float payment5) {
        this.payment5 = payment5;
    }

    public String getXsdh() {
        return xsdh;
    }

    public void setXsdh(String xsdh) {
        this.xsdh = xsdh;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    /*//--------------------
     *//** 主键（自增长）不使用 *//*
    public int id;
    *//**
     * 一个微信公众号一个weid
     * 关联 ims_wechats的weid
     *//*
    public int weid;
    *//**
     * 用户的唯一身份ID关联ims_card_members的 from_user
     *//*
    public String fromUser;
    *//** 交易时间 *//*
    public String jysj;
    *//** 交易类型(消费) *//*
    public String jylx = "消费";
    *//** 收银机号 *//*
    public String syjh;
    *//** 操作人 *//*
    public String yhmc;
    *//** 交易记录id *//*
    public String dealId;
    *//** 交易记录门店，关联ims_idish_stores的bmbh *//*
    public String bmbh;
    *//** 应收金额 *//*
    public float jezj;
    *//** 现金支付金额 *//*
    public float cash = 0.0f;
    *//** 储值卡支付金额 *//*
    public float payment1;
    *//** 销售单号 单号+bmbh *//*
    public String xsdh;
    *//***
     * Uid会员唯一标示对应ims_fans中的ID 好像不加也没关系
     *//*
    public int uid;

    *//**
     * @param weid     一个微信公众号一个weid关联 ims_wechats的weid
     * @param fromUser 用户的唯一身份ID关联ims_card_members的 from_user
     * @param jysj     交易时间
     * @param syjh     收银机号 就是设备名称
     * @param yhmc     操作人
     * @param bmbh     交易记录门店，关联ims_idish_stores的bmbh
     * @param dealId   交易记录id
     * @param jezj     应收金额
     * @param payment1 储值卡支付金额
     * @param xsdh     单号_bmbh
     *//*
    public DealRecord(int weid, String fromUser, String jysj, String syjh, String yhmc, String bmbh, String dealId, float jezj, float payment1, String xsdh) {
        this.weid = weid;
        this.fromUser = fromUser;
        this.jysj = jysj;
        this.syjh = syjh;
        this.yhmc = yhmc;
        this.bmbh = bmbh;
        this.dealId = dealId;
        this.jezj = jezj;
        this.payment1 = payment1;
        this.xsdh = xsdh;
    }

    *//**
     * 例子:
     * insert into deal_record (weid, from_user, JYSJ, JYLX, SYJH, YHMC, bmbh, deal_id, cash, jezj, payment1, xsdh) values
     * (175, 'o1_uLv_KDKjZb3UTnhAQSxAYh2M0', '2017-02-14 09:57:35', '消费', 'ZYB', '޿', 'djnr01', '6', 0, 17, 17,
     * 'ZYB20170213182119093_djnr01');
     *//*
    public String toInsertString() {
        return "insert into deal_record (weid,          from_user,     JYSJ,       JYLX,           SYJH,           YHMC,          bmbh,          deal_id,           cash,         jezj,         payment1,         xsdh) " +
                "            values (" + weid + ", '" + fromUser + "', '" + jysj + "', '" + jylx + "', '" + syjh + "', '" + yhmc + "', '" + bmbh + "', '" + dealId + "', " + cash + ", " + jezj + ", " + payment1 + ",'" + xsdh + "')|";
    }*/
}
